package com.eascs.crm.web.service;

import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Service;

import com.eascs.app.dao.PageResult;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.crm.common.entity.CustomerBasicInfoEntity;
import com.eascs.crm.common.entity.CustomerUnit;
import com.eascs.crm.common.vo.QueryCustomerVO;
import com.eascs.crm.server.manger.ICustomerInfoManager;

@Service
public class LocalCustomerInfoServiceImpl {

	private final Logger logger = LoggerFactory.getLogger(LocalCustomerInfoServiceImpl.class);

	@Inject
	ICustomerInfoManager customerInfoManager;



	public String addCustomer(CustomerBasicInfoEntity customerBasicInfoEntity) {
		return customerInfoManager.addCustomer(customerBasicInfoEntity);
	}

	public boolean updateCustomer(CustomerBasicInfoEntity customerBasicInfoEntity) {
		return customerInfoManager.updateCustomer(customerBasicInfoEntity);
	}

	public PageResult<CustomerBasicInfoEntity> findCustomerBaseInfo(QueryCustomerVO vo) {
		PageResult<CustomerBasicInfoEntity> page = customerInfoManager.findCustomerBaseInfo(vo);
		return page;
	}

	public PageResult<Object[]> findCustomerUnitInfo(String customerId, String unitId) {
		PageResult<Object[]> page=customerInfoManager.findCustomerUnitInfo(customerId, unitId);
		return page;
	}
	
	public List<CustomerUnit> getCustomerUnitInfo(String customerId){
		List<CustomerUnit> list = customerInfoManager.getCustomerUnitInfo(customerId);
		return list;
	}
	
	public String addCustomerUnit(CustomerUnit CustomerUnit){
		return  customerInfoManager.addCustomerUnit(CustomerUnit);
	}
	
	public String getUnitCount(String customerId){
		return customerInfoManager.getUnitCount(customerId);
	}
	
	public boolean delUnit(String unit_id,String customer_id){
		return customerInfoManager.delUnit(unit_id,customer_id);
	}
}
